import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home/index.vue')
  },
  {
    path: '/home/make',
    name: 'make',
    component: () => import('../views/home/make/index.vue')
  },
  {
    path: '/home/search',
    name: 'search',
    component: () => import('../views/home/search/index.vue')
  },
  {
    path: '/home/info',
    name: 'info',
    component: () => import('../views/home/info/index.vue')
  },
  {
    path: '/home/info/order',
    name: 'order',
    component: () => import('../views/home/info/order/index.vue')
  },
  {
    path: '/home/topic',
    name: 'topic',
    component: () => import('../views/home/topic/index.vue')
  },
  {
    path: '/home/newRoute',
    name: 'newRoute',
    component: () => import('../views/home/newRoute/index.vue')
  },
  {
    path: '/home/location',
    name: 'location',
    component: () => import('../views/home/location/index.vue')
  },
  {
    path: '/topic',
    name: 'topic',
    component: () => import('../views/topic/index.vue')
  },
  {
    path: '/category',
    name: 'category',
    component: () => import('../views/category/index.vue')
  },
  {
    path: '/category/info',
    name: 'info',
    component: () => import('../views/category/info/index.vue')
  },
  
  {
    path: '/cart',
    name: 'cart',
    component: () => import('../views/cart/index.vue')
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/my/index.vue')
  },
  {
    path: '/my/collect',
    name: 'collect',
    component: () => import('../views/my/collect/index.vue')
  },
  {
    path: '/my/address',
    name: 'address',
    component: () => import('../views/my/address/index.vue')
  },
  
  {
    path: '/my/editAdress',
    name: 'editAdress',
    component: () => import('../views/my/editAdress/index.vue')
  },
  {
    path: '/my/newAdress',
    name: 'newAdress',
    component: () => import('../views/my/newAdress/index.vue')
  },
  {
    path: '/my/opinion',
    name: 'opinion',
    component: () => import('../views/my/opinion/index.vue')
  }
  
]

const router = new VueRouter({
  routes
})

export default router
